<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=@page_title || "卡特尔16种人格测试报告"%></title>
<link href="/stylesheets/survey_public.css" rel="stylesheet" type="text/css" />
<!--[if IE]><script language="javascript" type="text/javascript" src="/javascripts/jquery/excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="/javascripts/jquery/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/jquery/jquery.flot.min.js"></script>
<script language="javascript"> 
    function printsetup()  {
            web.execwb(8,1); // 打印页面设置
    }
    function printpreview()  {
            web.execwb(7,1); //打印页面预览
    }
    function copyToClipBoard()  {
            var clipBoardContent="";
            clipBoardContent+=document.title;
            clipBoardContent+="\n";
            clipBoardContent+=this.location.href;
            window.clipboardData.setData("Text",clipBoardContent);
            alert("复制成功，粘贴即可！");
    }
</script>

<style>
#content{ width:885px; float:left;}
.content01{ width:885px; float:left; height:42px; border-bottom:1px solid #1a80d0;}
.content01 ul{ width:748px; float:left; padding-left:80px;}
.content01 ul li{ width:69px; float:left; border-right:1px dashed #1a80d0; height:42px; line-height:42px; text-align:center; color:#000000;}
.content01 ul li.bb{ width:49px;}
.content01 ul li.bb02{ width:39px;}
.content01 ul li.bb03{ width:105px;}
.content01 ul li.bb04{ width:180px; border-right:none;}

.content02{ width:715px; float:left; padding:36px 0 0 80px;}
#tj{ width:500px; height:44px; float:left;}
#tj li{ width:107px; height:44px; float:left;}
#tj li.jj{ width:200px; height:30px; float:left; border:1px solid rgb(218, 218, 218); text-align:center; line-height:30px; color:#000000; margin-top:12px;}

#df{ width:450px; float:left; margin:15px  0 ;}
#df li{ width:131px; float:left;}
#df li.ff{ width:209px; float:left; margin-top:15px;}

#dimen{ width:680px; float:left; margin-top:15px;}
#dimen li.ff{ width:420px;  float:left; margin:15px  0 ;}
#dimen li.ff2{ width:209px;  float:left; margin:100px  0 10px  0 ;}

#dimen_ex{ width:450px; float:left; margin-top:15px;}
#dimen_ex li{ width:131px; float:left; }
#dimen_ex li.right{ width:209px;  float:left; margin:15px  0 ;}

.bian{ width:209px; height:1px; background:#dadada;}
#bg{ width:610px; float:left; margin:15px  0 ;}
#bg li{ width:72px; float:left;}

.back{ width:102px; height:35px; float:right; padding-right:20px; margin:20px 5px 0 0;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/report/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}

#zhidaoyijian{margin:0 0 0 100px;width:630px}
h1{font-size:18px;}

div #dimens {margin:90px 0 0 100px;width:630px}
table tr td{padding:2px 10px 2px 10px; }
</style>

<style type="text/css" media="print">
  .noprint{display : none }
</style>
</head>

<body>
<div id="page">
	<div id="header">
		<ol>
                  <li id="title-text"><%= @test_record.survey.name %></li>
		</ol>
		<ul>
                  <li id="org-text">
                  <%=current_user.name%>
                </li>
                  <li><a href="/login/logout">安全退出</a></li>
		</ul>
        </div>
	<div id="content">
    	<div class="content01">
        	<ul>                                           
            <li>姓名</li>
            <li><%=@test_record.username%></li>
            <li>性别</li>
            <li class="bb"><%=@test_record.gender%></li>
            <li>年龄</li>
            <li class="bb02"><%=@test_record.age%></li>
            <li class="bb03">测量日期</li>
            <li class="bb04"><%=@test_record.created_at.strftime('%Y年 %m月%d日')%></li>
            </ul>
        </div>
       
        <div id="dimens">

          <h1>得分统计</h1>
          <table>
            
            <tr>
              <td>因子</td>
              <% @expls[:dimens].keys.each do |key| %>
              <td><%= key %> </td>
              <% end %>
            </tr>
            <tr>
              <td>原始分</td>
              <% @expls[:dimens].keys.each do |key| %>
              <td><%= @expls[:dimens][key][:value] %></td>
              <% end %>
            </tr>
            <tr>
              <td>T分</td>
              <% @expls[:dimens].keys.each do |key| %>
              <td><%= @expls[:dimens][key][:t] %></td>
              <% end %>
            </tr>
          </table>
        </div>


        <div id="zhidaoyijian">
          <h1>人格因素分析</h1>

          <div id="chart0" style="width:300px;height:400px;">16PF人格剖面图</div>

          人格特征：
          <table>
            <% @expls[:dimens].keys.each do |key| %>
              <% if @expls[:dimens][key][:expl] != "no" %>
            <tr>
              <td width=""><b><%= key %>&nbsp;<%=@expls[:dimens][key][:expl]["解释"]%> </b></td>
              
            </tr>
            <tr>
              <td><%= @expls[:dimens][key][:expl]["特征描述"] %></td>
            </tr>
              <% end %>
            <% end %>
          </table>

          次级人格特征：
          <table>
            <% @expls[:dimens2].each do |e| %>
            <tr>
              <td><b><%= e[:name] %></b></td>
            </tr>
            <tr>
              <td height="40" style="padding-left:40px"><%= e[:expl] %></td>
            </tr>
            <% end %>
          </table>

        </div>

                  <!--打印功能-->
         <!--
        <div class="msg" id="webprint" style="mrgiin:10px 100px 0 0;float:right; width:250px;">
      <object classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" id="web" name="web" height="0" width="0"></object>
      <input type="button" value="  打  印 " onclick="javascript:window.print();" />
      <input type="button" value="打印预览" onclick="window.print();" />
      <br /><br />
       
      </div>
         webprint -->
        <div class="back">
          <% if controller_name == "prof_surveys" %>
          <a href="/surveys/prof_surveys"><img src="/images/back.png" width="88" height="27" style="margin-left:10px;"/></a>
          <% else %>
          <a href="/user/reports"><img src="/images/back.png" width="88" height="27" style="margin-left:10px;"/></a>
          <% end %>
        </div>
    </div>
</div>
<div id="footer">
<h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>
</div>

  <script>
    $(function () {


      function showChart(series) {

        var data = series;

        var markings = [
            { color: '#B2DF45', lineWidth: 2, xaxis: { from: -1, to:-1} },
            { color: '#B2DF45',lineWidth: 2, xaxis: { from:1, to: 1 } }
        ];
        var i = 16;
        var j = 16;
        var options = {
          //bars: {show: true, barWidth: 0.5, fill: 0.9,horizontal:true, align:'center'},
          points: {show: true},
          lines: {show: true},
          xaxis: {
            //tickDecimals: 0,
            //tickSize: 1 ,
            ticks: [[-4.5, "1"],[-3.5, "2"],[-2.5, "3"],[-1.5, "4"],
               [-0.5, "5"], [0.5, "6"], [1.5, "7"], [2.5, "8"], [3.5, "9"], [4.5, "10"]]
          },
          yaxis:{
            ticks: [[i--, "A"],[i--, "B"], [i--, "C"], [i--, "E"], [i--, "F"], [i--, "G"],
                    [i--, "H"], [i--, "I"] ,[i--, "L"], [i--, "M"], [i--, "N"], [i--, "O"],
                    [i--, "Q1"], [i--, "Q2"], [i--, "Q3"], [i--, "Q4"]]
          },
          y2axis: {
            ticks: [[j--, "A"],[j--, "B"], [j--, "C"], [j--, "E"], [j--, "F"], [j--, "G"],
              [j--, "H"], [j--, "I"] ,[j--, "L"], [j--, "M"], [j--, "n"], [j--, "O"],
              [j--, "Q1"], [j--, "Q2"], [j--, "Q3"], [j--, "Q4"]]
          },
          grid: { markings: markings }
        };
        //绘制图表
        $.plot($("#chart0"), data, options);
      }

      //$.ajax({
        //  url: "/data-eu-gdp-growth.json",
          //method: 'GET',
          //dataType: 'json',
          ///success: showChart
      //});
      showChart(<%=@expls[:json]%>);

    });
  </script>
</body>
</html>
